<%@page import="Model.My.PurchaseResultListView"%>
<%@page import="Model.Purchase.PurchaseOfferList"%>
<%@page import="RssEasy.Core.HttpRequestHelper"%>
<%@page import="Model.Supplier.SupplierExcellentView"%>
<%@page import="Model.Purchase.PurchaseList"%>
<%@page import="Model.Purchase.PurchaseMaterielListView"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    PurchaseMaterielListView pml = new PurchaseMaterielListView(pageContext);
    PurchaseList pl = new PurchaseList(pageContext);
    SupplierExcellentView sev = new SupplierExcellentView(pageContext);
    PurchaseResultListView prlv = new PurchaseResultListView(pageContext);
    pl.request();
    String purchaseid = pl.get("id");

    if (!pl.select().where("id=? and (state=2 or state=3)", purchaseid).get_first_rows()) {
        out.print("<script>document.location='/purchase/list';</script>");
    }
    pl.select("name,shijian,linkname,phone,enddt,summary,conditions,state").where("id=?", purchaseid).get_first_rows();

%>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>询比价项目定标详情</title>
        <meta http-equiv="X-UA -Compatible" content="IE=edge">
        <meta name="description" content="这里写网站内容描述" />
        <meta name="keywords" content="这里写关键词" />
        <meta name="Robots" contect="all">
        <link href="/css/reset.css" rel="stylesheet" type="text/css"/>
        <link href="/inc/head.css" rel="stylesheet" type="text/css"/>
        <link href="/inc/footer.css" rel="stylesheet" type="text/css"/>
        <link href="/purchase/css/result.css" rel="stylesheet" type="text/css"/>
    </head>
    <body id="caigouxm">
        <%@include file="/inc/head.jsp"%>
        <h1 class="details_position w1000">当前位置：采购项目＞项目详情</h1>
        <div class="content w1000">
            <div class='purchase_details w1000'>
                <img class="hummar" src="/purchase/img/dingbiao<%=pl.get("state")%>.png" alt=""/>
                <div class="details_title">
                    <h2><%=pl.get("name")%></h2>
                    <h3>发布时间&nbsp;<span rssdate="<%=pl.get("shijian")%>,yyyy-MM-dd hh:mm"></span></h3>
                </div>
                <div class="details_content1">
                    <h2>项目名称：<span><%=pl.get("name")%></span></h2>
                    <h4>联系人：<span><%=pl.get("linkname")%></span></h4>
                    <h2>联系电话：<span><%=pl.get("phone")%></span></h2>
                    <h3>截止时间：<span rssdate="<%=pl.get("enddt")%>,yyyy-MM-dd"></span></h3>
                </div>
                <h2>项目简介：</h2>
                <p><%=pl.get("summary")%></p>
                <h2>供应商资格要求：</h2>
                <p class="details_p"><%=pl.get("conditions")%></p>
            </div>
            <div class='latest w1000'>
                <h1>最新发布</h1>
                <ol>
                    <%
                        pl.pagesize = 5;
                        pl.select("id,name,shijian").where("state=1 and typid=1").get_page_desc("id");
                        while (pl.for_in_rows()) {
                    %>
                    <li><img src="/purchase/img/purchase_create_list1.jpg" alt=""/><a href='/purchase/details/<%=pl.get("id")%>' title="<%=pl.get("name")%>"><%=pl.get("name")%></a><span rssdate='<%=pl.get("shijian")%>,yyyy-MM-dd'></span></li>
                            <%
                                }
                            %>
                </ol> 
            </div>

            <div class="right2 w1000">
                <h1>优秀供应商排行榜</h1>
                <ol>
                    <%
                        sev.request();
                        sev.select("myid,corpname").get_page_desc("rank");
                        sev.pagesize = 10;
                        int n = 1;
                        while (sev.for_in_rows()) {
                    %>
                    <li><div class="color<%out.print(n);%>"><%out.print(n);%></div><a href="/supplier/home/<%=sev.get("myid")%>" title="<%=sev.get("corpname")%>"><%=sev.get("corpname")%></a></li>
                            <%
                                    n += 1;
                                }
                            %>
                </ol>
            </div>
            <div class="result_btm">
                <div class="tabletop">详细参数:</div>
                <table id="table" class="tc cellbor">
                    <thead>
                        <tr>
                            <th class="th2 w50">序号</th>
                            <th class='w160'>物料名称</th>
                            <th class="w100">规格型号</th>
                            <th class="w100">数量</th>
                            <th class="w100">单位</th>
                            <th class="th6 w100">图片</th>
                        </tr>
                    </thead>
                    <tbody>
                        <%
                            pml.select("materielname,model,amout,unit,attachurl").where("purchaseid=?", purchaseid).get_page_asc("purchaseid");
                            int i = 1;
                            while (pml.for_in_rows()) {

                        %>
                        <tr>
                            <td><%=i%></td>
                            <td><%=pml.get("materielname")%></td>
                            <td><%=pml.get("model")%></td>
                            <td><%=pml.get("amout")%></td>
                            <td><%=pml.get("unit")%></td>
                            <td><img src="/upfile/<%=pml.get("attachurl")%>"/></td>
                        </tr>
                        <%
                                i++;
                            }
                        %>
                    </tbody>
                </table>
            </div>
            <%
                pl.select("state").where("id=?", purchaseid).get_first_rows();
            %>
            <h2>项目结果：<span result="<%=pl.get("state")%>"></span></h2><br>
            <h3>中标人：</h3>
            <ul>
                <%
                    prlv.select("corpname").where("purchaseid=? and result=1", purchaseid).get_page_asc("id");
                    while (prlv.for_in_rows()) {
                %>
                <li><%=prlv.get("corpname")%></li> 
                    <%
                        }
                    %>
            </ul>
        </div>
        <%@include file="/inc/footer.jsp"%>
        <%@include file="/inc/js_all.html" %>
        <script src="/js/calendar.min.js" type="text/javascript"></script>
        <script src="/purchase/js/dictdata.js" type="text/javascript"></script>
    </body>
</html>
